# -*- encoding=utf8 -*-
"""
RedFlag-TC000084   拍照道具清除检查
拍照时清除道具场景
"""
__author__ = "ldm"

import sys
import os

# 获取当前脚本所在目录.py
current_dir = os.path.dirname(os.path.abspath(__file__))
# 获取上级目录.air
parent_dir = os.path.dirname(current_dir)
# 获取上级目录air
grandparent_dir = os.path.dirname(parent_dir)
# 获取和air目录平级的conf、testcase目录路径
conf_dir = os.path.join(grandparent_dir, 'conf')
testcase_dir = os.path.join(grandparent_dir, 'testcase')
# 将conf、testcase目录添加到sys.path
sys.path.append(conf_dir)
sys.path.append(testcase_dir)

from PageFunction import CameraVideoShooter
from elements import *
auto_setup(__file__)

shooter = CameraVideoShooter()

log("--------------------------------拍照时清除道具场景--------------------------------------")
"""
进入拍照
点击道具
点击冰雪贺新春
选择第一个道具
断言
点击清除按钮
断言
"""

shooter.enter_photo()
shooter.click_element(shooting_page_prop)
shooter.click_element(prop_ice_celebrate_Chinese_new_year)
shooter.click_element(shooting_page_select_prop[0])
shooter.assert_image_exists(r"tpl1747313870375.png", "断言失败，未发现道具图片", record_pos=(-0.195, -0.842), resolution=(1224, 2700))
shooter.click_element(shooting_page_item_removal)
shooter.assert_image_not_exists(r"tpl1747313870375.png", "断言失败，发现道具图片", record_pos=(-0.195, -0.842), resolution=(1224, 2700))
# 关闭应用
stop_app(UGC_package_name)